package com.laosg.resource.ssoclient1;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: kevin
 * @Date: 2019/10/16 9:21 PM
 */
@RestController
public class TestController {

    @GetMapping("/hello")
    @PreAuthorize("hasAuthority('123')")

    public String get(Authentication authentication){
        return "hello:"+authentication.getName();
    }
}
